/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.config.controller;

import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.punish.config.dto.ConfigDictionaryInfoQueryDto;
import com.icinfo.cloud.provider.punish.config.dto.ConfigDictionaryCaseSourceInfoQueryDto;
import com.icinfo.cloud.provider.punish.config.service.IConfigDictionaryInfoService;
import com.icinfo.cloud.provider.punish.config.vo.ConfigDictionaryInfoVo;
import com.icinfo.cloud.provider.punish.config.vo.ConfigDictionaryCaseSourceInfoVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 描述: 数据字典配置表 config_dictionary_info 对应的Controller类.<br>
 *
 * @author framework generator
 * @date 2022年02月15日
 */
@RestController
@RequestMapping("/sys/dictionary")
@Slf4j
public class ConfigDictionaryInfoController extends BaseController {
    @Autowired
    private IConfigDictionaryInfoService configDictionaryInfoService;


    /**
     * 【V1.0.0】描述：查询指定数据字典列表信息
     *
     * @param queryDto {@link ConfigDictionaryInfoQueryDto}
     * @return {@link Result<List<ConfigDictionaryInfoVo>>} 数据字典列表信息
     * @author xiangyuyu
     * @date 2022-02-23 20:40
     */
    @PostMapping("/getConfigDictionaryList")
    @ApiOperation(value = "【V1.0.0】描述：查询指定数据字典列表信息", httpMethod = "POST")
    public Result<List<ConfigDictionaryInfoVo>> getConfigDictionaryList(@RequestBody @Validated ConfigDictionaryInfoQueryDto queryDto) {
        List<ConfigDictionaryInfoVo> configDictionaryInfoList = configDictionaryInfoService.getConfigDictionaryList(queryDto);
        return Result.success(Constant.STRING_GET_SUCCESS,configDictionaryInfoList);
    }

    /**
     * 【V1.0.0】描述：查询案件来源数据字典列表信息
     *
     * @param queryDto {@link ConfigDictionaryInfoQueryDto}
     * @return {@link Result<List<ConfigDictionaryInfoVo>>} 数据字典列表信息
     * @author xiangyuyu
     * @date 2022-02-23 20:40
     */
    @PostMapping("/getConfigDictionaryCaseSourceList")
    @ApiOperation(value = "【V1.0.0】描述：查询案件来源数据字典列表信息", httpMethod = "POST")
    public Result<List<ConfigDictionaryCaseSourceInfoVo>> getConfigDictionaryCaseSourceList(@RequestBody @Validated ConfigDictionaryCaseSourceInfoQueryDto queryDto) {
        List<ConfigDictionaryCaseSourceInfoVo> configDictionaryInfoList = configDictionaryInfoService.getConfigDictionaryCaseSourceList(queryDto);
        return Result.success(Constant.STRING_GET_SUCCESS,configDictionaryInfoList);
    }
}
